﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using LM.Negocio.Objetos;

namespace LM.Repositorios.Maps
{
    class OperadorMap: EntityTypeConfiguration<Operador>
    {
        public OperadorMap()
        {
            this.HasKey(m => m.Codigo);
            this.Property(m => m.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity).HasColumnName("Id");
            this.Property(m => m.Codigo).HasColumnName("Codigo").IsRequired();
            this.Property(m => m.Nome).HasColumnName("Nome").IsRequired().HasMaxLength(20);
            this.Property(m => m.Senha).HasColumnName("Senha").IsRequired().HasMaxLength(10);
            this.Property(m => m.Status).HasColumnName("Status").IsRequired();

            this.ToTable("OPERADOR");
        }
    }
}

